home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dirut / rh_ls.zip / LS.DOC < prev    next >
Text File  |  1990-09-19  |  9KB  |  211 lines

  1. ls - a Unix-like directory listing program for MS-DOS
  2.  
  3.  
  4. Syntax: ls [-aclmrstuR] [(path)name ... ]
  5.  
  6.     Options may appear in any order, grouped or separated; if separate,
  7.     each must be preceded by a dash.  The name(s) may refer to files or
  8.     directories.  If no name is given the current directory is listed.
  9.  
  10. Options:
  11.  
  12.     (none)  Show filenames according to the default settings
  13.       -a    Reverse the "list all files" option default
  14.       -c    Reverse the "one-column listing" option default
  15.       -h    Print the help message and the default settings
  16.       -l    Reverse the "long listing" option default
  17.       -m    Reverse the 'pause for more" option default
  18.       -r    Reverse the default sort direction
  19.       -R    Recursively list sub-directories
  20.       -s    Print sizes
  21.       -s1   Print sizes for single-sided diskette
  22.       -s2   Print sizes for double-sided diskette
  23.       -t    Reverse the "time sort" option default
  24.       -u    Reverse the "include disk usage" option default
  25.  
  26. Description:
  27.  
  28. The basic action is to list the filenames in the current directory, sorted
  29. alphabetically into 5 columns.  If the (path)name of a directory/filename
  30. pattern is specified, all files which match the pattern in the specified
  31. directory are listed.  Wildcard characters ("*", "?") are acceptable in
  32. the filename part of a directory/filename pattern.   Subdirectories are
  33. identified by a trailing directory separator character in the basic list
  34. format.
  35.  
  36. The basic action may be modified or replaced by alternative actions by
  37. specifying options on the command line or by changing the default settings
  38. options using MS-DOS environment variables.  These options are described
  39. below:
  40.  
  41.  
  42.     Option: -a    Variable for default setting: LSALL
  43.  
  44. System files, "hidden" files and the directory synonyms "." and ".." are
  45. normally not included in the listing, but this option will bring them out
  46. of the woodwork.  "Volume Labels" are always ignored.  If they have any
  47. logic or value it has been carefully hidden by Microsoft.
  48.  
  49.  
  50.     Option: -c    Variable for default setting: LSCOLM
  51.  
  52. This option forces output into a single column, so "ls -c" will give a
  53. sorted list of filenames (only) in a single column, and "ls -lc" will
  54. provide a "long" listing in one column instead of two.  These formats can
  55. be useful if you want to use the file names or information for further
  56. operations (e.g. as arguments in ".bat" files).  This format is the 4.2bsd
  57. Unix default when sending the listing to any device other than the display;
  58. here you must explicitly ask for single column output to get it.
  59.  
  60.  
  61.     Option: -h    Default setting is always: OFF
  62.  
  63. The -h option causes ls to output a summary of its options and a list of
  64. the current default settings.  After this, it terminates with no further
  65. action.`
  66.  
  67.  
  68.     Option: -l    Variable for default setting: LSLONG
  69.  
  70. This option yields a two-column "long" listing, sorted vertically by column,
  71. showing nearly everything known about the files (i.e. all the news that fits).
  72. The file attributes are shown symbolically by single characters: "d" for
  73. directories or "s" for system files, "h" for hidden files, and "w" for writable
  74. (not read-only) files.  The lack of one of these attributes is shown by a dash.
  75. The actual length of the file, in bytes, is given unless the -u option is
  76. included (see below).  The month and time of the last modification are shown if
  77. the file is less than 12 months old, otherwise month and year are printed.
  78.  
  79. Note that the file sizes displayed in the "long" listing will always be smaller
  80. than the actual disk space used, because MS-DOS never writes a record smaller
  81. than the "cluster" size -- which is 1024 bytes on a 9-sector floppy and 4096
  82. bytes on a hard disk with only a DOS partition present.  
  83.  
  84.  
  85.     Option: -m    Variable for default setting: LSMORE
  86.  
  87. This option causes the listing to be paused every 22 lines and print the
  88. message "--MORE--" if the listing is being output to the console.  You may
  89. respond with "C" or "c" to continue with another 22 lines, "Q" or "q" to
  90. terminate the listing immediately, or with a carriage return to receive one
  91. more line of listing followed by another pause.
  92.  
  93.  
  94.     Option: -r    Variable for default setting: LSRSORT
  95.  
  96. This option causes the order of the listing to be reversed, i.e., from
  97. z to a for alphabetic sorts and and from earliest to latest for time sorts
  98. (refer to the -t option).
  99.  
  100.  
  101.     Option: -R    Default setting is always: OFF
  102.  
  103. The -R option will include (recursively) the contents of any subdirectories
  104. encounterd, and their subdirectories, ad finitum.  This can be a lengthy
  105. listing on a hard disk; if started in the root directory with the -a option
  106. it lists the whole shebang.
  107.  
  108.  
  109.     Option: -s    Default setting is always: OFF
  110.  
  111. This option omits filenames (unless they are specified on the command line)
  112. and lists sizes only.  This effectively shuts off the -l, -t and -r options,
  113. and turns -u on, yielding a nifty summary of disk usage by directory, along
  114. with a total at the end and the space remaining on the drive.  Include -a if
  115. you want hidden and system files to show up.
  116.  
  117. As a special case, the -s option recognizes the numerals "1" and "2" (they
  118. must immediately follow the "s" option) and will use disk block sizes
  119. appropriate to single-sided diskettes (-s1) or double-sided diskettes (-s2)
  120. in the calculatation of actual disk usage.  This is useful if you want to
  121. know if a given set of files is going to fit on a diskette that uses block
  122. sizes different from those on the source disk.  For example, MS-DOS is far
  123. more profligate with disk space on a hard disk than on a floppy, and disk
  124. use appears to "shrink" onto a floppy backup.  These options can tell you
  125. how much shrinkage to expect.
  126.  
  127.  
  128.     Option: -t    Variable for default setting: LSTSORT
  129.  
  130. The listed filenames will be sorted according to their last modification time
  131. if this option is set ON, normally latest first.
  132.  
  133.  
  134.     Option: -u    Variable for default setting: LSDU
  135.  
  136. This option tells you how much disk space is actually used.  If only one
  137. filename or directory is listed, its total disk use is shown, followed by
  138. its identifying (path)name.  If the -l option is included with -u, the size
  139. shown for each file is the amount of disk space used -- almost always larger
  140. than the file size. More than one name on the command line will get you
  141. successive listings, with disk use subtotals preceding the identifying
  142. (path)name, and followed by the total disk space used by the files listed.
  143. All this is followed by the space remaining on the drive; if more than one
  144. drive is involved, it is the space remaining on the last one on the command
  145. line.
  146.  
  147.  
  148.     Option: none    Variable for default setting: LSID
  149.  
  150. This option tells ls that you want it to always print the directory name
  151. with the listing.  Note that this option cannot be modified from the command
  152. line.
  153.  
  154.  
  155.     Option: none    Variable for default setting: LSQS
  156.  
  157. This option allows you to set the directory file pathname separator.  ls
  158. assumes the character "\" is used for this purpose.  If you desire to
  159. change this you may set the LSQS environemnt variable to the desired
  160. character.  Actually, your only allowable alternative is the character "/",
  161. the characters "\" and "/" are the only directory file pathname separators
  162. supported by MS-DOS.
  163.  
  164.  
  165. Installation:
  166.  
  167. To install and use, simply copy the file ls.com into you binary files
  168. directory (to be accessed via you "path" setting) or in the directory
  169. (or directories) in which you intend to use this command.  If you
  170. wish to change default settings, simply execute a set command for
  171. each setting you wish to change (excellent use for an autoexec.bat
  172. file).
  173.  
  174. If you want to mess with the code, the following information is useful:
  175. compiller used was Microsoft C 5.1
  176. cl ls.c
  177.  
  178. Using "ls":
  179.  
  180. The program has to be loaded into memory before it can run, then it must
  181. consult the disk directory to find things.  This is a bit slow on a floppy
  182. but is gratifyingly fast if the program is located on a hard disk or in
  183. a ram disk, if there are less than a screenful of filenames to be shown